<template>
  <div class="loginpage">
    <comheadertwo></comheadertwo>
    <!-- <transition name="index" mode="out-in"> -->
    <loginbox
      v-if="isLogin"
      btnText="登录"
      spanText="免费注册"
      key="login"
      :isLogin="isLogin"
      @changeLogin="changeLogin"
    ></loginbox>
    <loginbox
      v-else
      btnText="注册"
      spanText="登录"
      key="register"
      :isLogin="isLogin"
      @changeLogin="changeLogin"
    ></loginbox>
    <!-- </transition> -->
    <comfooter></comfooter>
  </div>
</template>

<script>
import comheadertwo from "../components/common/comheadertwo.vue";
import loginbox from "../views/login/loginbox.vue";
import comfooter from "../components/common/comfooter.vue";
export default {
  components: {
    comheadertwo,
    loginbox,
    comfooter
  },
  data() {
    return {
      isLogin: true,
    };
  },
  methods: {
    changeLogin() {
      this.isLogin = !this.isLogin;
    },
  },
};
</script>

<style lang="scss" scoped>
.loginpage {
  width: 100%;
}
.index-leave-to {
  opacity: 0;
}

.index-enter {
  opacity: 0;
}

.index-leave-active,
.index-enter-active {
  transition: all 0.3s;
}
</style>